import { Component } from '@angular/core';

import { ConfirmModalService } from '@core/base';
import { NzMessageService } from 'ng-zorro-antd/message';

@Component({
  selector: 'app-modal-confirm',
  templateUrl: './modal-confirm.component.html',
  styleUrls: ['./modal-confirm.component.less']
})
export class ModalConfirmComponent {
  constructor(private confirmModalSrc: ConfirmModalService, private messageSrc: NzMessageService) {}

  info(): void {
    this.confirmModalSrc.info('<b>这是确认信息(粗体)</b>').subscribe(ok => {
      if (ok) {
        this.messageSrc.info('确认');
      } else {
        this.messageSrc.info('取消');
      }
    });
  }

  danger(): void {
    this.confirmModalSrc.danger('这是危险信息').subscribe(ok => {
      if (ok) {
        this.messageSrc.info('确认');
      } else {
        this.messageSrc.info('取消');
      }
    });
  }
}
